package com.henu.engineer.dao.mapper.student;

import com.henu.engineer.dao.entity.student.StudentScoreDtl;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * @author noexcept
 * @date 2021/7/27 21:17
 */
@Mapper
@Repository
public interface StudentScoreDtlXmlMapper {

    boolean insertSingle(StudentScoreDtl studentScoreDtl);

    int insertList(List<StudentScoreDtl> scoreDtlList);

    boolean deleteSingle(String studentId, String testPaperId, String questionNum);

    /**
     * 更新某学生的某试卷的某一题的分数
     */
    boolean updateSingle(String studentId, String testPaperId, String questionNum, Double score);

    /**
     * 查询，某学生某试卷所有题的得分
     * @param studentId
     * @param testPaperId
     * @return 键为题号，值为分数
     */
    List<Map<String,Double>> selectQuestionNumAndScore(String studentId, String testPaperId);

    /**
     * 查询某试卷试卷某一题所有学生的分数
     * @param testPaperId
     * @param questionNum
     * @return 返回值StudentScoreDtl中的testPaperId和questionNum为NULL
     */
    List<StudentScoreDtl> selectByTestPaperAndQuestionNum(String testPaperId,String questionNum);



}
